Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vtable entry for covariant IEnumerable<object> for WinRT types too. #601

Merged
merged 4 commits into from
Nov 24, 2020

Conversation

manodasanW
Copy link
Member

@manodasanW manodasanW commented Nov 20, 2020

Adding a more complete covariant support. For covariant interfaces, we get all the possible types that can be passed for the generic and create a vtable entry for them. Along with that, if the generic is itself a covariant interface, we do the same for it.

For now, I haven't removed the previous version of this function as it was a public function.

Fixes #592
Fixes #598

@manodasanW
Copy link
Member Author

manodasanW commented Nov 23, 2020

I realized there were other covariance scenarios still broken, made an attempt at solving them all.

@@ -206,6 +207,7 @@ private static bool IsTypeWindowsRuntimeTypeNoArray(Type type)
|| type.GetCustomAttribute<WindowsRuntimeTypeAttribute>() is object;
}

// Use TryGetCompatibleWindowsRuntimeTypesForVariantType instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the comment a TODO?

Copy link
Member Author

@manodasanW manodasanW Nov 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the issue is this API was marked public even though we only used it internally. Since we don't expect anyone else to use it or for it to be used in cross module scenarios, we can accept the breaking change and remove the old version of the API. But before I did that, I wanted to make sure there weren't concerns with that, so I instead put a comment.

@manodasanW manodasanW merged commit d9f1d21 into master Nov 24, 2020
@manodasanW manodasanW deleted the manodasanw/ienumstring branch November 24, 2020 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants